package priv.pront.code.lanqiao.competition.course.date0329;

import java.math.BigInteger;
import java.util.Scanner;

public class 麦森数 {
    static int P;
    static StringBuilder sb = new StringBuilder();
    static String s = "";

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        P = scanner.nextInt();
        BigInteger bi = new BigInteger("2").pow(P).subtract(new BigInteger("1"));
        int length = bi.toString().length();
        System.out.println(length);
        if (length < 500) {
            for (int i = 0; i < 500 - length; i++) {
                sb.append(0);
            }
            String ans = sb.toString() + bi;
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 50; j++) {
                    System.out.print(ans.charAt((i * 50 + j)));
                }
                System.out.println();
            }
        } else {
            String bis = bi.toString();
            int start = bis.length() - 500;
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 50; j++) {
                    System.out.print(bis.charAt(start + i * 50 + j));
                }
                System.out.println();
            }
        }
    }
}
